Welcome to Computational Musicology 2021!

Welcome to Computational Musicology 2021!

You can access the lecture notes at the following links.

This storyboard contains further examples from each week to inspire you. You can download the raw source code of the storyboard here.

What kind of portfolio do I need to create?

Your portfolio will be a 5–10-page dashboard in the style of the R package flexdashboard, using data from the Spotify API. Your dashboard should cover the following topics, but note that it is possible (and often desirable) for a single visualisation or tab to cover more than one topic.

Depending on your topic, you may want to start with a text-based opening like this one; alternatively, you could put your most compelling visualisation directly on the first tab and just use the commentary to introduce your corpus and research questions.


The grading breakdown for the portfolio is as follows. The rubric was adapted from the Association of American Colleges and Universities (AAC&U) Inquiry and Analysis and Quantitative Literacy VALUE rubrics.

Component Points
Corpus selection 6
Assumptions 6
Representation 6
Interpretation 6
Analysis 6
Presentation 6
Transfer of learning 6

Do the Dutch really listen to happier music? [track-level features]


In March 2019, The Economist published a graphic showing a worldwide dip in the emotional valence of the music to people people listen around February each year. The graphic also broke down the emotional valence for every month of the year for a selection of Spotify markets, and it revealed quite a surprise: although overall, there seemed to be two large groups, with Latin America and Spain listening to more positively valenced music than most of the rest of the world, the Netherlands stood on its own somewhere in between these two extremes. This graphic compares Spotify Top 50 in the Netherlands against Belgium, a more typical neighbouring country, as well as the worldwide average, on the standard valence–arousal model. More popular songs (worldwide) have larger dots; more danceable songs are yellow.

The Tallis Scholars sing Josquin more slowly than La Chapelle Royale – except for one part [chroma features].


This visualisation of two performances of the famous ‘Ave Maria’ setting of Josquin des Prez uses the Aitchison distance between chroma features to show how the two performances align with one another.

For the first four stanzas, the relationship between the performances is consistent: the Tallis Scholars sing the piece somewhat more slowly than La Chapelle Royale. For the fifth stanza (Ave vera virginitas, starting about 3:05 into the Tallis Scholars’ performance and 2:25 into La Chapelle Royale’s), the Tallis Scholars singing faster than La Chapelle Royale, but at the beginning of the sixth stanza (Ave preclara omnibus, starting about 3:40 into the the Tallis Scholars’ performance and 3:05 into La Chapelle Royale’s) the Tallis Scholars return to their regular tempo relationship with La Chapelle.

Although the interactive mouse-overs from ggplotly are very helpful for understanding heat maps, they are very computationally intensive. Chromagrams and similarity matrices are often better as static images, like the visualisation at left.

What is the structure of ‘Blood, Sweat, and Tears’ [chroma and timbre features]


The two self-similarity matrices at the right, each summarised at the bar level but with axes in seconds, illustrate pitch- and timbre-based self-similarity within Andre Hazes’s famous ‘Bloed, Zweet en Tranen’ (2002). Both are necessary to understand the structure of the song. The chroma-based matrix picks up the five presentations of the chorus very clearly but mostly misses the poignant changes in texture during the three verses. These changes are very visible in the timbre-based matrix, especially the third verse. The timbre-based matrix also illustrates the unbalanced song structure, climaxing about halfway through and thereafter simply repeating the chorus until the fade-out. The closing guitar solo is faintly visible in the top-right corner.

Truck-driver modulations in the Year 2525 [tonal analysis]


The keygram at the left shows the two modulations in Zager and Evans’s ‘In the Year 2525’ (1969). The piece is segmented according to Spotify’s estimates, and the distances represented are Aitchison distances from Spotify’s chroma vectors to the original Krumhansl–Kessler key profiles (1990).

The piece does not follow common-era tonal conventions, and the key estimates are blurry. The move from G\(\sharp\) minor to A minor about a minute and a half into the song is correctly estimated, despite the high spillage into related keys. The second modulation, to B\(\flat\) minor, is misunderstood as F minor. The sparser texture two-and-a-half minutes into the song throws off the key-finding algorithm seriously.

How am I supposed to dance when I can’t find the beat? [temporal features]


The Fourier-based tempogram at the left is an attempt to use Spotify’s API to analyse the tempo of Graveola’s ‘Samba de outro lugar’. Overall, Spotify estimates that the tempo of this track is 124 BPM, but looking in more detail at the tempogram, we see that the different sections of the piece lead to different strengths of so-called tempo octaves. In some freer-form sections of the piece, tempo estimation is almost impossible.

Classifying independent workouts


The mosaic at the left shows the performance of a classifier trying to distinguish three Spotify playlists: Indie Pop, Indie Party, and Indie Workout. Using a random-forest classifier, the most important features for classifying tracks among these playlists are:

After these five features, there is a substantial drop in importance. The mosaic displays the results, after 10-fold cross-validation, of a nearest-neighbour classifier with just these five features.

The performance of the classifier is mediocre: overall classification accuracy is 55 percent, with a J-index of 0.32. Although these features are reasonably effective at identifying the party and pop playlists, the precision of the classifier’s predictions of workout tracks is very low: when the classifier predicts that a track is a workout track, it is just as likely to be a party or pop track.

Either Spotify’s Indie Workout playlist is not as tailored to workouts as its names would lead users to believe, or we need features beyond the Spotify itself to make the distinction.

What are the components of a Hallowe’en playlist?


The dendrogram and heatmap at right breaks the Bibliothèque nationale de France’s Hallowe’en playlist into four clusters based on Gower’s distance. First, there is a small, more classical cluster, that stay strictly in their original keys with low values for C sharp, G sharp, and A sharp. Second, there is a group of danceable, high-energy tracks. The third group is difficult to characterise on the basis of the heatmap: if anything, there seems to be lower emphasis on major thirds and leading tones, perhaps pentatonic tonality. The final group clearly represents the non-instrumental, low-valence tracks on the list.

The song titles make it clear that the over-arching them of this list has more to do with textual than musical content, however, which is not available in the Spotify API.